Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan Level 2 #217

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

PHPStan Level 2 #217

wants to merge 6 commits into from

Conversation

lloc
Copy link
Contributor

@lloc lloc commented Feb 26, 2025

This PR implements several code quality improvements to meet PHPStan level 2 requirements. The changes fix issues with property access, type declarations, and namespace resolutions across classes.

Changes

  • Set PHPStan analysis level to 2
  • Fixed property access of an object of \WP_Site
    • Changed incorrect name property to correct blogname property
  • Addressed property naming of object of type \WP_Network
    • Renamed sitename to site_name for consistency
    • Ignoring false positive when access to private $blog_id property through magic methods
  • Fixed parameter type declaration of var that is passed to WP_MS_Networks_List_Table::pagination()
  • Ignoring root namespace resolution issue for WP_User return type from WP_CLI\Fetchers\User::get()

No functional changes have been made — these are strictly quality improvements that help prevent potential bugs and make the codebase easier to maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant